package com.itlong.cloud.user.operate;

import com.itlong.cloud.POJO.DTO.operate.OperatePropertyAccountGetPageDTO;
import com.itlong.cloud.POJO.DTO.operate.OperatePropertyAccountSaveDTO;
import com.itlong.cloud.POJO.DTO.operate.OperatePropertyAccountUpdateDTO;
import com.itlong.cloud.POJO.DTO.operate.OperatePropertyDeveloperGetPageDTO;
import com.itlong.cloud.POJO.VO.app.robot.AppProjectRobotInfoVO;
import com.itlong.cloud.POJO.VO.operate.OperatePropertyAccountDetailVO;
import com.itlong.cloud.POJO.VO.operate.OperatePropertyAccountVO;
import com.itlong.cloud.POJO.VO.operate.OperatePropertyDeveloperVO;
import com.itlong.cloud.POJO.VO.operate.OperatePropertyRoleVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <desc>
 *      运营-物业账号信息业务处理暴露接口
 * </desc>
 *
 * @createDate 2017-10-25.
 */
@FeignClient(name = "user-service")
public interface IOperatePropertyAccountServiceClient {

    /**
     * <desc>
     *      获取公共管理员列表
     * <desc/>
     *
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/getPubRoles",method = {RequestMethod.POST})
    List<OperatePropertyRoleVO> getPropertyRoles() throws Exception;

    /**
     * <desc>
     *      检测物业账号名存在性
     * <desc/>
     *
     * @param userName 账号名
     * @return 同名账号个数
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/exist",method = {RequestMethod.POST})
    Integer checkPropertyAccountExist(@RequestParam(name = "userName") String userName) throws Exception;

    /**
     * <desc>
     *      检测某项目某角色用户是否已存在（每个项目的每个公共角色，只能有一个用户）
     * <desc/>
     *
     * @param projectId 项目id
     * @param roleId 角色id
     * @param propertyUserId 排除物业用户id
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-31
     */
    @RequestMapping(path = "/operate/project/propertyUser/projectRoleExist",method = {RequestMethod.POST})
    Integer checkProjectRoleExist(@RequestParam(name = "projectId") String projectId,
                                  @RequestParam(name = "roleId", required = false) String roleId,
                                  @RequestParam(name = "propertyUserId", required = false) String propertyUserId) throws Exception;

    /**
     * <desc>
     *      添加新的物业账号
     * <desc/>
     *
     * @param saveDTO 新增物业账号信息
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/add",method = {RequestMethod.POST})
    Integer savePropertyAccount(@RequestBody OperatePropertyAccountSaveDTO saveDTO) throws Exception;

    /**
     * <desc>
     *      添加新的物业账号(返回账号)
     * <desc/>
     *
     * @param saveDTO 新增物业账号信息
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/savePropertyAccountSaas",method = {RequestMethod.POST})
    String savePropertyAccountSaas(@RequestBody OperatePropertyAccountSaveDTO saveDTO) throws Exception;

    /**
     * <desc>
     *      修改单个物业账号
     * <desc/>
     *
     * @param updateDTO 账号修改信息
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/update",method = {RequestMethod.POST})
    Integer updatePropertyAccount(@RequestBody OperatePropertyAccountUpdateDTO updateDTO) throws Exception;

    /**
     * <desc>
     *      批量删除物业账号
     * <desc/>
     *
     * @param userIds 物业账号id列表，多个以英文逗号分隔
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/del",method = {RequestMethod.POST})
    Integer removePropertyAccounts(@RequestParam(name = "userIds") String userIds) throws Exception;

    /**
     * <desc>
     *      分页获取物业账号列表
     * <desc/>
     *
     * @param pageDTO 查询条件
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-25
     */
    @RequestMapping(path = "/operate/project/propertyUser/getPage",method = {RequestMethod.POST})
    Page<OperatePropertyAccountVO> getPage(@RequestBody OperatePropertyAccountGetPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      获取单个物业账号详情
     * <desc/>
     *
     * @param userId 用户id
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/getDetail",method = {RequestMethod.POST})
    OperatePropertyAccountDetailVO getDetail(@RequestParam(name = "userId") String userId) throws Exception;

    /**
     * <desc>
     *      批量重置物业账号密码
     * <desc/>
     *
     * @param userIds 物业账号id，多个以英文逗号分隔
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-27
     */
    @RequestMapping(path = "/operate/project/propertyUser/resetPwd",method = {RequestMethod.POST})
    Integer resetPassword(@RequestParam(name = "userIds") String userIds) throws Exception;

    /**
     * <desc>
     *      分页获取物业开发者账号列表
     * <desc/>
     *
     * @param pageDTO 查询条件
     * @return
     * @author Qiang.S
     * @createDate 2018-06-29
     */
    @RequestMapping(path = "/operate/project/propertyUser/getDeveloperPage",method = {RequestMethod.POST})
    Page<OperatePropertyDeveloperVO> getDeveloperPage(@RequestBody OperatePropertyDeveloperGetPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      删除开发者账号
     * <desc/>
     *
     * @param userId 物业账号id
     * @param projectId 项目编号
     * @return
     * @author Qiang.S
     * @createDate 2018-09-07
     */
    @RequestMapping(path = "/operate/project/propertyUser/removePropertyDeveloper",method = {RequestMethod.POST})
    Integer removePropertyDeveloper(@RequestParam(name = "userId") String userId,@RequestParam(name = "projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取开发者下的项目及机器人信息
     * </desc>
     *
     * @param userId 开发者用户id
     * @return 项目及机器人信息
     * @Author Zhu.yj
     * @createDate  2020/8/25
     */
    @RequestMapping(value = "operate/project/propertyUser/getProjectRobotInfoByDeveloper", method = {RequestMethod.POST})
    List<AppProjectRobotInfoVO> getProjectRobotInfoByDeveloper(@RequestParam("userId") String userId,@RequestParam("loginType") String loginType) throws Exception;

    /**
     * <desc>
     *      获取工程人员项目
     * </desc>
     *
     * @param userId 用户id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/8/25
     */
    @PostMapping("/operate/engineer/getEngineerProjectIds")
    List<String> getEngineerProjectIds(@RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      分页获取管理员列表
     * </desc>
     *
     * @param accountGetPageDTO 分页查询参数DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2020/10/22
     */
    @PostMapping("/operate/project/propertyUser/getAdminPage")
    Page<OperatePropertyAccountVO> getAdminPage(@RequestBody OperatePropertyAccountGetPageDTO accountGetPageDTO) throws Exception;

    /**
     * <desc>
     *      处理集团物业管理员旧数据菜单，收回不该有的权限
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2021/5/21
     */
    @PostMapping("handlerGroupAdminFunction")
    Integer handlerGroupAdminFunction() throws Exception;
}
